#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
using namespace std;
int main(){
	int m,n,temp;
	cin >> n >> m;
	int moon[1024] = {0};
	int max = -1;
	for(int i = 0;i < m;i++){
		for(int j = 1;j <= n;j++){
			cin >> temp;
			moon[j] += temp;
		}
	}
	for(int i = 1;i <= n;i++){
		if(moon[i]>max) max = moon[i];
	}
	cout << max << endl;
	int flag = 0;
	for(int i = 1;i <= n;i++){
		if(max==moon[i]){
			if(flag) cout << " ";
			cout << i;
			flag = 1;
		}
	}
	return 0;
}
